Skip to content

Dependabot updates + Migration to new ESLint flat config system #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Mar 10, 2025

Conversation

marwan37
Copy link
Contributor

@marwan37 marwan37 commented Mar 10, 2025

This PR migrates our ESLint configuration from the legacy .eslintrc files to the new flat config system (eslint.config.js) introduced in ESLint v9. I've also updated the TypeScript configuration to resolve import path issues and fixed various linting errors throughout the codebase.

Dependency Changes

Upgrades

  • @types/mocha: 10.0.610.0.10
  • @vscode/vsce: 2.24.03.2.2
  • eslint: 8.56.09.22.0 (Major version upgrade)
  • ts-loader: 9.5.19.5.2
  • webpack-cli: 5.1.46.0.1 (Major version upgrade)

Additions

  • @eslint/js: ^9.22.0
  • eslint-plugin-prettier: ^5.2.3
  • typescript-eslint: ^8.26.0

Removals

  • @typescript-eslint/eslint-plugin
  • @typescript-eslint/parser

Notable Changes

  • Migrated from the standalone TypeScript ESLint packages to the unified typescript-eslint package
  • Replaced .eslintrc and .eslintrc.json with a single eslint.config.mjs
  • Added ESLint prettier plugin for better integration between ESLint and Prettier
  • Renamed webpack.config.js to webpack.config.mjs and updated import syntax

ESLint Rule Changes

  • @typescript-eslint/consistent-type-definitions: Set to off instead of error to ease migration
  • @typescript-eslint/no-explicit-any: Maintained as warning
  • @typescript-eslint/no-unused-vars: Maintained as warning

Summary by CodeRabbit

  • Chores

    • Updated dependencies, Node.js versions, and CI/CD configurations to ensure a more robust development environment.
    • Introduced a new Node version specification and ESLint configuration for improved consistency.
  • Refactor

    • Streamlined code by removing unused parameters and reorganizing import statements for clearer maintenance.
    • Removed unused interfaces and constants to simplify the codebase.
  • Tests

    • Improved test declarations and mock setups for enhanced stability and reliability.

@marwan37 marwan37 added the CI label Mar 10, 2025
Copy link
Contributor

coderabbitai bot commented Mar 10, 2025

Walkthrough

This pull request removes obsolete ESLint configuration files and updates dependency versions and declarations in the project’s configuration files. It also refactors several source files by removing unused callback parameters and reorganizing import statements. Test files have been streamlined with updated variable declarations and import adjustments, while view and type files have minor refactorings. Additionally, Node.js versions have been updated in CI workflows, and the webpack configuration has been migrated to ES module syntax.

Changes

File(s) Change Summary
.eslintrc, .eslintrc.json Removed obsolete ESLint configuration files tailored for TypeScript projects.
package.json Updated dependency versions, added "@eslint/js" and "eslint-plugin-prettier", removed deprecated ESLint TypeScript packages, and adjusted other related dependencies.
src/commands/components/cmds.ts, src/commands/server/cmds.ts, src/commands/stack/cmds.ts, src/services/LSClient.ts Removed unused callback parameters (e.g., progress), changed a variable declaration from let to const, and simplified object destructuring in setActiveStack.
src/commands/server/utils.ts, src/commands/stack/registry.ts, src/common/python.ts, src/common/settings.ts, src/common/vscodeapi.ts Reordered and removed unused import statements and ESLint disable comments without affecting functionality.
src/test/ts_tests/** Consolidated test imports, updated variable declarations (e.g., changing let to const), and removed unused variables across various test files.
src/views/activityBar/** Removed an unused interface, adjusted destructuring in a method, and refactored error item parsing in error tree items.
src/types/HydratedTypes.ts, tsconfig.json Added documentation comments, modified export order, and incorporated "esModuleInterop": true for improved module interoperability.
src/commands/pipelines/DagRender.ts Changed the fs/promises import from a default import to a namespace import.
.github/actions/lint/action.yml, .github/workflows/ci.yml, .github/workflows/release.yml, .nvmrc Updated Node.js versions (workflows now use 20.x and .nvmrc specifies v22.14.0) to ensure current runtime features.
eslint.config.mjs, webpack.config.mjs Introduced a new ESLint configuration file and migrated the webpack configuration from CommonJS to ES module syntax.

Possibly related PRs

  • Integrate mypy and yamlfix, fix Conda dependency resolution, add release workflow #23: The changes in the main PR, which involve the removal of the .eslintrc file, are related to the retrieved PR that integrates yamlfix for linting and formatting, as both address ESLint configurations and linting processes for TypeScript projects.
  • Bump dependencies to resolve Dependabot alerts #109: The changes in the main PR, which involve the removal of the .eslintrc file and updates to the package.json, are related to the retrieved PR as both involve modifications to ESLint configurations and updates to the @typescript-eslint/parser dependency in package.json.
  • Dependencies Update #121: The changes in the main PR, which involve the removal of the .eslintrc file, are related to the updates in the retrieved PR that include changes to the eslint-config-prettier dependency, indicating a connection through ESLint configuration management.

Suggested labels

dependencies

Suggested reviewers

  • strickvl

Poem

I'm a little rabbit, hopping through the code,
Trimming out the unused bits along my winding road.
ESLint files are gone, and dependencies are in view,
Variables are const now, and imports are fresh and new.
In every line I nibble, there's magic to be found—
A joyful, clean refactor in every bound!
🐇✨


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
webpack.config.js (1)

3-3: Redundant 'use strict' directive.

The 'use strict' directive is redundant in ES modules as they operate in strict mode by default.

- 'use strict';
🧰 Tools
🪛 Biome (1.9.4)

[error] 2-3: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c402081 and 8160fb8.

📒 Files selected for processing (1)
  • webpack.config.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.js`: Review the JavaScript code for conformity with th...

**/*.js: Review the JavaScript code for conformity with the Google JavaScript style guide, highlighting any deviations.

  • webpack.config.js
🔇 Additional comments (1)
webpack.config.js (1)

7-60:

❓ Verification inconclusive

Ensure configuration compatibility with webpack when using ES modules.

The webpack configuration uses several CommonJS patterns. If fully converting to ES modules, verify that the configuration works properly with webpack's ES module support.


🏁 Script executed:

#!/bin/bash
# Check webpack version and compatibility
npm list webpack
# Also check if this project is using webpack-cli and its version
npm list webpack-cli

Length of output: 145


Ensure ES Module Compatibility in Webpack Configuration

The webpack configuration in webpack.config.js (lines 7–60) currently uses CommonJS patterns. If you plan to switch fully to ES modules, please verify that:

  • The configuration works correctly with webpack’s ES module support.
  • Your project’s package.json properly includes and specifies versions for both webpack and webpack-cli, as the initial npm lookup returned no output. Consider manually checking these dependencies to confirm they are set up correctly.
🧰 Tools
🪛 ESLint

[error] 18-18: '__dirname' is not defined.

(no-undef)


[error] 54-54: '__dirname' is not defined.

(no-undef)


[error] 59-59: 'module' is not defined.

(no-undef)

coderabbitai[bot]

This comment was marked as resolved.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/test/ts_tests/commands/stackCommands.test.ts (1)

82-82: Consider avoiding any type assertions

Type assertions using as any bypass TypeScript's type checking, which can hide potential type errors. Consider creating proper mock objects that satisfy the expected types instead.

// Instead of:
await stackCommands.renameStack({ label: 'Old Stack', id: stackId } as any);

// Consider:
const mockStackItem: StackTreeItem = { 
  label: 'Old Stack', 
  id: stackId 
  // Add other required properties
} as StackTreeItem;
await stackCommands.renameStack(mockStackItem);
📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0a35019 and 11b3d84.

📒 Files selected for processing (6)
  • src/commands/pipelines/DagRender.ts (1 hunks)
  • src/test/ts_tests/__mocks__/MockViewProviders.ts (1 hunks)
  • src/test/ts_tests/commands/stackCommands.test.ts (1 hunks)
  • src/test/ts_tests/extension.test.ts (2 hunks)
  • src/test/ts_tests/integration/serverConfigUpdate.test.ts (1 hunks)
  • src/test/ts_tests/unit/eventBus.test.ts (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • src/test/ts_tests/mocks/MockViewProviders.ts
  • src/test/ts_tests/unit/eventBus.test.ts
  • src/commands/pipelines/DagRender.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/test/ts_tests/extension.test.ts
  • src/test/ts_tests/integration/serverConfigUpdate.test.ts
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.ts`: Review the Typescript code for conformity with in...

**/*.ts: Review the Typescript code for conformity with industry standards and best practices, highlighting any deviations.

  • src/test/ts_tests/commands/stackCommands.test.ts
🔇 Additional comments (1)
src/test/ts_tests/commands/stackCommands.test.ts (1)

14-22: Import statements improved for better code organization

The refactoring of import statements improves code organization and maintainability by:

  1. Using consistent namespaced imports (e.g., import * as sinon from 'sinon')
  2. Making explicit imports for dependencies (stackUtils, EventBus, LSClient, globalUtils)
  3. Better structuring of imports for clarity

This change aligns with modern TypeScript best practices and will make dependency tracking clearer throughout the codebase.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/dependabot.yml (1)

9-9: Minor Formatting Detail: Extra Spacing in Directory Line
The extra spacing after the directory value (/ # Location of package manifests) does not affect functionality, but please confirm that this intentional formatting aligns with your team's style guidelines.

📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 56ee328 and 3659924.

📒 Files selected for processing (81)
  • .github/dependabot.yml (1 hunks)
  • eslint.config.mjs (1 hunks)
  • resources/components-form/components.css (1 hunks)
  • resources/components-form/components.js (1 hunks)
  • resources/dag-view/dag.css (1 hunks)
  • resources/dag-view/dag.js (1 hunks)
  • resources/stacks-form/stacks.css (1 hunks)
  • resources/stacks-form/stacks.js (1 hunks)
  • src/commands/components/ComponentsForm.ts (1 hunks)
  • src/commands/components/cmds.ts (2 hunks)
  • src/commands/components/registry.ts (1 hunks)
  • src/commands/environment/cmds.ts (1 hunks)
  • src/commands/environment/registry.ts (1 hunks)
  • src/commands/pipelines/DagRender.ts (1 hunks)
  • src/commands/pipelines/cmds.ts (1 hunks)
  • src/commands/pipelines/registry.ts (1 hunks)
  • src/commands/pipelines/utils.ts (1 hunks)
  • src/commands/server/cmds.ts (3 hunks)
  • src/commands/server/registry.ts (1 hunks)
  • src/commands/server/utils.ts (1 hunks)
  • src/commands/stack/StackForm.ts (1 hunks)
  • src/commands/stack/cmds.ts (5 hunks)
  • src/commands/stack/registry.ts (1 hunks)
  • src/commands/stack/utils.ts (1 hunks)
  • src/common/WebviewBase.ts (1 hunks)
  • src/common/api.ts (1 hunks)
  • src/common/constants.ts (1 hunks)
  • src/common/log/logging.ts (1 hunks)
  • src/common/panels.ts (1 hunks)
  • src/common/python.ts (1 hunks)
  • src/common/server.ts (1 hunks)
  • src/common/settings.ts (1 hunks)
  • src/common/status.ts (1 hunks)
  • src/common/utilities.ts (1 hunks)
  • src/common/vscodeapi.ts (1 hunks)
  • src/extension.ts (1 hunks)
  • src/services/EventBus.ts (1 hunks)
  • src/services/LSClient.ts (3 hunks)
  • src/services/ZenExtension.ts (2 hunks)
  • src/test/python_tests/lsp_test_client/constants.py (1 hunks)
  • src/test/python_tests/lsp_test_client/session.py (4 hunks)
  • src/test/python_tests/lsp_test_client/utils.py (1 hunks)
  • src/test/ts_tests/__mocks__/MockEventBus.ts (1 hunks)
  • src/test/ts_tests/__mocks__/MockLSClient.ts (4 hunks)
  • src/test/ts_tests/__mocks__/MockViewProviders.ts (1 hunks)
  • src/test/ts_tests/__mocks__/constants.ts (1 hunks)
  • src/test/ts_tests/commands/serverCommands.test.ts (2 hunks)
  • src/test/ts_tests/commands/stackCommands.test.ts (2 hunks)
  • src/test/ts_tests/extension.test.ts (2 hunks)
  • src/test/ts_tests/integration/serverConfigUpdate.test.ts (1 hunks)
  • src/test/ts_tests/unit/ServerDataProvider.test.ts (1 hunks)
  • src/test/ts_tests/unit/eventBus.test.ts (1 hunks)
  • src/types/HydratedTypes.ts (3 hunks)
  • src/types/LSClientResponseTypes.ts (1 hunks)
  • src/types/LSNotificationTypes.ts (1 hunks)
  • src/types/PipelineTypes.ts (1 hunks)
  • src/types/ServerInfoTypes.ts (1 hunks)
  • src/types/StackTypes.ts (1 hunks)
  • src/utils/componentUtils.ts (1 hunks)
  • src/utils/constants.ts (1 hunks)
  • src/utils/global.ts (1 hunks)
  • src/utils/notifications.ts (1 hunks)
  • src/utils/refresh.ts (1 hunks)
  • src/views/activityBar/common/ErrorTreeItem.ts (2 hunks)
  • src/views/activityBar/common/LoadingTreeItem.ts (1 hunks)
  • src/views/activityBar/common/PaginatedDataProvider.ts (1 hunks)
  • src/views/activityBar/common/PaginationTreeItems.ts (1 hunks)
  • src/views/activityBar/common/TreeItemWithChildren.ts (1 hunks)
  • src/views/activityBar/componentView/ComponentDataProvider.ts (1 hunks)
  • src/views/activityBar/environmentView/EnvironmentDataProvider.ts (1 hunks)
  • src/views/activityBar/environmentView/EnvironmentItem.ts (1 hunks)
  • src/views/activityBar/environmentView/viewHelpers.ts (1 hunks)
  • src/views/activityBar/pipelineView/PipelineDataProvider.ts (1 hunks)
  • src/views/activityBar/pipelineView/PipelineTreeItems.ts (1 hunks)
  • src/views/activityBar/serverView/ServerDataProvider.ts (1 hunks)
  • src/views/activityBar/serverView/ServerTreeItems.ts (1 hunks)
  • src/views/activityBar/stackView/StackDataProvider.ts (2 hunks)
  • src/views/activityBar/stackView/StackTreeItems.ts (1 hunks)
  • src/views/panel/panelView/PanelDataProvider.ts (1 hunks)
  • src/views/panel/panelView/PanelTreeItem.ts (1 hunks)
  • src/views/statusBar/index.ts (1 hunks)
✅ Files skipped from review due to trivial changes (56)
  • src/views/panel/panelView/PanelTreeItem.ts
  • src/views/activityBar/common/PaginationTreeItems.ts
  • src/test/python_tests/lsp_test_client/utils.py
  • src/views/panel/panelView/PanelDataProvider.ts
  • src/types/LSClientResponseTypes.ts
  • src/views/activityBar/pipelineView/PipelineTreeItems.ts
  • resources/dag-view/dag.css
  • src/views/activityBar/common/TreeItemWithChildren.ts
  • src/common/constants.ts
  • src/types/LSNotificationTypes.ts
  • src/types/PipelineTypes.ts
  • src/views/activityBar/serverView/ServerDataProvider.ts
  • src/types/ServerInfoTypes.ts
  • src/common/server.ts
  • src/types/StackTypes.ts
  • resources/dag-view/dag.js
  • resources/stacks-form/stacks.js
  • resources/stacks-form/stacks.css
  • src/utils/notifications.ts
  • src/commands/components/registry.ts
  • src/test/python_tests/lsp_test_client/constants.py
  • src/common/panels.ts
  • src/utils/global.ts
  • src/test/ts_tests/mocks/MockEventBus.ts
  • src/utils/componentUtils.ts
  • src/utils/constants.ts
  • src/test/ts_tests/mocks/constants.ts
  • src/common/WebviewBase.ts
  • src/commands/stack/utils.ts
  • src/common/api.ts
  • src/commands/stack/StackForm.ts
  • resources/components-form/components.css
  • src/utils/refresh.ts
  • src/commands/pipelines/utils.ts
  • src/views/activityBar/environmentView/EnvironmentItem.ts
  • src/views/activityBar/common/PaginatedDataProvider.ts
  • src/views/activityBar/environmentView/viewHelpers.ts
  • src/common/utilities.ts
  • src/common/log/logging.ts
  • src/views/statusBar/index.ts
  • src/commands/environment/registry.ts
  • src/commands/environment/cmds.ts
  • src/commands/server/registry.ts
  • src/views/activityBar/common/LoadingTreeItem.ts
  • src/extension.ts
  • src/views/activityBar/stackView/StackTreeItems.ts
  • src/commands/pipelines/cmds.ts
  • src/commands/pipelines/registry.ts
  • src/services/ZenExtension.ts
  • src/common/status.ts
  • resources/components-form/components.js
  • src/commands/components/ComponentsForm.ts
  • src/views/activityBar/environmentView/EnvironmentDataProvider.ts
  • src/test/python_tests/lsp_test_client/session.py
  • src/services/EventBus.ts
  • src/views/activityBar/serverView/ServerTreeItems.ts
🚧 Files skipped from review as they are similar to previous changes (24)
  • src/commands/components/cmds.ts
  • src/commands/server/cmds.ts
  • src/common/vscodeapi.ts
  • src/views/activityBar/pipelineView/PipelineDataProvider.ts
  • src/test/ts_tests/mocks/MockLSClient.ts
  • src/test/ts_tests/mocks/MockViewProviders.ts
  • src/common/python.ts
  • src/commands/server/utils.ts
  • src/views/activityBar/common/ErrorTreeItem.ts
  • src/commands/stack/registry.ts
  • src/test/ts_tests/unit/eventBus.test.ts
  • src/common/settings.ts
  • src/services/LSClient.ts
  • src/views/activityBar/componentView/ComponentDataProvider.ts
  • src/test/ts_tests/commands/serverCommands.test.ts
  • src/commands/stack/cmds.ts
  • src/test/ts_tests/unit/ServerDataProvider.test.ts
  • eslint.config.mjs
  • src/types/HydratedTypes.ts
  • src/test/ts_tests/integration/serverConfigUpdate.test.ts
  • src/test/ts_tests/extension.test.ts
  • src/test/ts_tests/commands/stackCommands.test.ts
  • src/views/activityBar/stackView/StackDataProvider.ts
  • src/commands/pipelines/DagRender.ts
🔇 Additional comments (1)
.github/dependabot.yml (1)

15-16: Improved Update-Types Declaration
Converting the multi-line update-types list to a single-line array ([minor, patch]) enhances clarity and conciseness while preserving the intended behavior.

@marwan37 marwan37 merged commit 527a242 into develop Mar 10, 2025
7 checks passed
@marwan37 marwan37 deleted the dependabot-updates branch March 10, 2025 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant